define(["jquery", "easy-admin","xm-select"], function ($, ea) {



    let laydate = layui.laydate
        , form = layui.form;
    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'point.pointgoods/index',
        add_url: 'point.pointgoods/add',
        edit_url: 'point.pointgoods/edit',
        delete_url: 'point.pointgoods/delete',
        export_url: 'point.pointgoods/export',
        modify_url: 'point.pointgoods/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', width: 60, title: 'id'},
                    {field: 'title', width: 150, title: '商品名称'},
                    {field: 'type', width: 150, title: '类型',selectList: {1:'商品兑换',2:'快递次数'}},
                    {field: 'logo', title: '商品logo', templet: ea.table.image, width: 120,search:false},
                    {field: 'market_price', title: '原价', width: 120},
                    {field: 'price', title: '销售价', width: 120},
                    {field: 'point', title: '所需积分',width: 120},
                    {field: 'stock', title: '库存', width: 120,},
                    {field: 'status', title: '状态', templet: ea.table.switch, width: 120, selectList: {0: '下架', 1: '上架'}, tips:"上架|下架"},
                    {field: 'create_time',width: 170, title: '创建时间',search: 'range'},
                    {width: 200, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {


            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});